<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'carSaledInfo.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="css/usedcar.css">

	<script type="text/javascript">
		function isLoad1(){
		var eauser = "${session.eauser}";
				if(eauser == ""){
					alert("请先登录!");
					return;
				}
				else{
					window.location = "newcar/newCarAction_showVendor";
				}
		}
		function isLoad2(){
		var eauser = "${session.eauser}";
				if(eauser == ""){
					alert("请先登录!");
					return;
				}
				else{
					window.location = "newcar/newCarAction_showCarType";
				}
		}
		function isLoad3(){
		var eauser = "${session.eauser}";
				if(eauser == ""){
					alert("请先登录!");
					return;
				}
				else{
					window.location = "newcar/newCarAction_newCarSaleQueryShow";
				}
		}
	</script>

  </head>
  
  <body onload="init()">
    <div id="main" style="width: 1150px;">

    <a href="javascript:void(0)" onclick="isLoad1();" style="font-size: 20px;font-weight: bold;padding-left: 20px;">销售商统计</a>
    <a href="javascript:void(0)" onclick="isLoad2();" style="font-size: 20px;font-weight: bold;padding-left: 20px;">车型统计</a>
    <a href="javascript:void(0)" onclick="isLoad3();" style="font-size: 20px;font-weight: bold;padding-left: 20px;">高级查询</a>
    <br/>	<table class="tbimg" cellpadding="0" cellspacing="0">
    				<tr style="text-align: center;">
						<td class="t" style="height: 40px; width: 40px;">车辆识别号
						</td>
						<td class="t" style="height: 40px; width: 40px;">品牌
						</td>
						<td class="t" style="height: 40px; width: 40px;">车系
						</td>
						<td class="t" style="height: 40px; width: 120px;">车型
						</td>
						<td class="t" style="height: 40px; width: 50px;">车主姓名
						</td>
						<td class="t" style="height: 40px; width: 100px;">身份证号
						</td>
						<td class="t" style="height: 40px; width: 50px;">车牌
						</td>
						<td class="t" style="height: 40px; width: 50px;">颜色
						</td>
						<td class="t" style="height: 40px; width: 100px;">销售商
						</td>
						<td class="t" style="height: 40px; width: 50px;">价格
						</td>
						<td class="t" style="height: 40px; width: 50px;">销售日期
						</td>
					</tr>
					<s:iterator var="newCarSale" value="#request.newCarList">
						<tr onmouseover="this.style.background='#FFE4D2'"
							onmouseout="this.style.background='#FFF'" align="center">
							<td class="t" style="height: 40px;"><s:property value="#newCarSale.vin" />
							</td>
							<td class="t" style="height: 40px;"><s:property value="#newCarSale.brand" />
							</td>
							<td class="t" style="height: 40px;"><s:property value="#newCarSale.department" />
							</td>
							<td class="t" style="height: 40px;"><s:property value="#newCarSale.carType" />
							</td>
							<td class="t" style="height: 40px;"><s:property value="#newCarSale.carOwnerName" />
							</td>
							<td class="t" style="height: 40px;"><s:property value="#newCarSale.identifcationNum" />
							</td>
							<td class="t" style="height: 40px;"><s:property value="#newCarSale.plateNum" />
							</td>
							<td class="t" style="height: 40px;"><s:property value="#newCarSale.color" />色
							</td>
							<td class="t" style="height: 40px;"><s:property value="#newCarSale.vendorName" />
							</td>
							<td class="t" style="height: 40px;"><s:property value="#newCarSale.money" />万
							</td>
							<td class="t" style="height: 40px;"><fmt:formatDate value="${newCarSale.opeTime}" pattern="yyyy-MM-dd" />
							</td>
						</tr>
					</s:iterator>
			</table>
			<br/>
			<div class="pager mb10">
				<a href="newcar/newCarAction_showSale?no=1"><span>首页</span></a>
				<c:if test="${sessionScope.pageNoCar != 1}">
					<a class="prv" href="newcar/newCarAction_showSale?no=${sessionScope.pageNoCar-1}"><span>上一页</span></a>
				</c:if>
				<c:forEach var="i" begin="${sessionScope.pageNoCenterCar -2}"
					end="${sessionScope.pageNoCenterCar + 2}">
					<c:if test="${i <= sessionScope.totalNoCar }">
						<c:choose>
							<c:when test="${i == sessionScope.pageNoCar}">
								<a href="javascript:void(0)"><strong><span>${i}</span></strong></a>
							</c:when>
							<c:otherwise>
								<a href="newcar/newCarAction_showSale?no=${i}"><span>${i}</span></a>
							</c:otherwise>
						</c:choose>
					</c:if>
				</c:forEach>
				<c:if test="${sessionScope.pageNoCar +4 < sessionScope.totalNoCar}">
					<a class="next" href="newcar/newCarAction_showSale?no=${sessionScope.pageNoCar+1}"><span>下一页</span></a>
				</c:if>
				<a href="newcar/newCarAction_showSale?no=${sessionScope.totalNoCar}"><span>末页</span></a>
				&nbsp;&nbsp;&nbsp;&nbsp;共有
				<label style="color: red;">
					${sessionScope.totalCar}
				</label>
				条信息
			</div>
    </div>
  </body>
</html>
